package com.xr.blog.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xr.blog.dao.BlogMenuMapper;
import com.xr.blog.pojo.BlogMenu;
import com.xr.blog.service.BlogMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;


@Service
public class BlogMenuServiceImpl extends ServiceImpl<BlogMenuMapper, BlogMenu> implements BlogMenuService {

    @Autowired
    BlogMenuMapper menuMapper;
    @Override
    public List<BlogMenu> findAllMenu() {
        return list(new QueryWrapper<BlogMenu>().orderByAsc("sort"));
    }

    @Override
    public BlogMenu findPhoto() {
        return getOne(new QueryWrapper<BlogMenu>().eq("name","相册"));
    }

    @Override
    public BlogMenu findMonitor() {
        return getOne(new QueryWrapper<BlogMenu>().eq("name","监控"));
    }
}